package com.licq.ldoc.parser.impl.annotation;

import java.lang.annotation.Annotation;

import net.sf.oval.constraint.NotEqual;

import com.licq.ldoc.domain.Attribute;
import com.licq.ldoc.domain.AttributeType;
import com.licq.ldoc.parser.AnnotationParsee;

public class NotEqualAnnotationParsee extends AnnotationParsee {

	public NotEqualAnnotationParsee(AnnotationParsee successor) {
		super(successor);
	}

	@Override
	protected void doParse(Attribute attribute, Annotation annotation) {
		if (AttributeType.STRING == attribute.getType()) {
			NotEqual notEqual = (NotEqual) annotation;
			attribute.appendComments(String.format(getText(), notEqual.value(),
					notEqual.ignoreCase() ? "(ignore case)" : ""));
		}
	}
	
}
